<template>
	<view>
		
		<!-- <u-navbar title="回访详情" @rightClick="rightClick" :autoBack="true" placeholder leftIconSize="22px"
			rightText="历史回访">
		</u-navbar> -->
		<view class="indexbody">
			<view class="indexbody_title">
				<view>{{info.name}}</view>
			</view>
			<view class="indexbody_content">
				<text v-if="info.sex==1">男</text>
				<text v-else-if="info.sex==2">女</text>
				<text>{{info.age}}岁</text>
				<text>{{info.idcard}}</text>
			</view>
			<view class="indexbody_address">
				<view class="">
					<image src="../../static/index/address.png" mode=""></image>
				</view>
				<view class="">
					<text>{{info.city}}{{info.detail}}</text>
				</view>
			</view>
			<view class="indexbody_phone">
				<text>{{info.phone}}</text>
				<u-icon name="phone-fill" color="#2979ff" size="28"></u-icon>
			</view>
		</view>
		<view class="visitor">
			<text>最新回访信息</text>
		</view>
		<view class="VisitorInformation">
			<view class="VisitorInformation_list">
				<text>负责人</text>
				<text>{{info.username}}</text>
			</view>
			<view class="VisitorInformation_list">
				<text>回访方式</text>
				<text v-if="info.type==0">暂无</text>
				<text v-else-if="info.type==1">电访</text>
				<text v-else-if="info.type==2">面访</text>
			</view>
			<view class="VisitorInformation_list">
				<text>回访时间</text>
				<text>{{info.createtime}}</text>
			</view>
			
			<view class="VisitorInformation_list">
				<text>居住环境</text>
				<text>{{info.live}}</text>
			</view>
			<view class="VisitorInformation_list">
				<text>个人卫生</text>
				<text>{{info.hygiene}}</text>
			</view>
			<view class="VisitorInformation_list">
				<text>身体状况</text>
				<text>{{info.body}}</text>
			</view>
			<view class="VisitorInformation_list">
				<view class="certificatee">
					<text>需求</text>
				</view>
				<view class="Demandcontent">
					<text>{{info.need}}</text>
				</view>
			</view>
			<view class="VisitorInformation_list">
				<view class="certificatee">
					<text>其他</text>
				</view>
				<view class="Demandcontent">
					<text>{{info.other}}</text>
				</view>
			</view>
			<view class="VisitorInformation_list">
				<view class="">
					<view class="certificate">
						回访凭证
					</view>
					<!-- <view class="VisitorInformation_list_image" v-for="intem in info.imgs">
						<image  :src="intem" mode="aspectFit" width="16rpx" height="160rpx"></image>
					</view> -->
					<view class="Voice_input">
						<view class="Image_box">
							<div class="box" v-for="(intem,index) in info.imgs" @click="clickImg(info.imgs,index)">
								<image :src="baseUrl+intem"  mode=""></image>
							</div>
							
						</view>
					
					</view>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 终止弹框
				show: false,
				closeOnClickOverlay:false,
				title: '中止回访原因',
				// 图片
				src: 'https://cdn.uviewui.com/uview/album/1.jpg',
				villager_record_id:'',
				info:{},
				stop_refuse:''
			};
		},
		onLoad(option) {
			this.villager_record_id = option.id;
			this.getDetail()
		},
		methods: {
			clickImg(imgs,index){
				let imgsArray = [];
					for (let i = 0; i < imgs.length; i++) {
						imgsArray.push(this.baseUrl+imgs[i]);
					}
					uni.previewImage({
						current: index,
						urls: imgsArray,
						indicator: 'number',
						loop: true
					});
				
			},
			getDetail() {
				let obj = {};
				 obj.villager_record_id=this.villager_record_id;
				
				
				
				this.$api.post('/api/villagers/historyvisitDetail',obj).then((res) => {
					if (res.code == 1) {
						this.info= res.data
					} else {
						this.toastMsg(res.msg);
					}
				})
			},
			
			
			
			rightClick() {
				uni.navigateTo({
					url: './Historical-return-visit'
				})
			},
			
			close(){
				this.closeOnClickOverlay = false;
			},
		}
	}
</script>
<style>
	page {
		background-color: #EFF1F5;
	}
</style>

<style lang="scss">
	/* 上传图片 */
		.Voice_input{
			border-bottom: 1px solid rgba(215,215,215,0.50);
		}
		
		.Image_box{
			display: flex;
			align-items: center;
			flex-wrap: wrap;
			margin-top: 15px;
			padding-bottom: 15px;
		}
		
		.box{
			width: 205rpx;
			height: 205rpx;
			border: 1rpx solid #dedede;
			display: flex;
			justify-content: center;
			align-items: center;
		}
		.box image{
			width: 100%;
			height: 100%;
		}
	//用户信息
	.indexbody {
		margin: 30rpx 20rpx;
		background-color: #fff;
		border-radius: 20rpx;

		.indexbody_title {
			display: flex;
			justify-content: space-between;
			padding: 20rpx 30rpx;

			image {
				width: 40rpx;
				height: 40rpx;
			}

			:first-child {
				font-weight: bold;
			}
		}

		.indexbody_content {
			background-color: #F8F8F8;
			margin: 10rpx 30rpx;
			padding: 10rpx;
			font-size: 24rpx;

			text {
				padding: 0 16rpx;
				border-right: 2rpx solid #333333;
			}

			:last-child {
				border-right: none;
			}
		}

		.indexbody_address {
			display: flex;
			margin: 20rpx 30rpx;

			image {
				width: 40rpx;
				height: 40rpx;
				margin-right: 18rpx;
			}
		}

		.indexbody_phone {
			display: flex;
			justify-content: center;
			background-color: #F8FAFF;
			padding-bottom: 24rpx;
			border-bottom-right-radius: 20rpx;
			border-bottom-left-radius: 20rpx;
			padding: 10rpx 0;

			text {
				margin-right: 20rpx;
			}
		}
	}

	.visitor {
		margin-left: 30rpx;
		color: #333333;
		font-size: 32rpx;
		font-weight: 500;
	}

	.VisitorInformation {
		margin: 40rpx 30rpx;
		background-color: #fff;
		border-radius: 20rpx;

		.VisitorInformation_list {
			padding: 30rpx;
			display: flex;
			justify-content: space-between;
			border-bottom: 2rpx solid #EFF1F5;

			text:first-child {
				color: #666666;
			}

			text:last-child {
				color: #333333;
			}

			.VisitorInformation_list_image {
				margin: 30rpx 0 0 0;
				display: inline-block;
				padding-right: 20rpx;
			}

		}

	}

	.certificatee {
		display: block;
		width: 260rpx;
		vertical-align: middle;
	}

	.Demandcontent {
		padding-left: 40rpx;
		margin-right: -10px;
	}

	.button {
		background-color: #fff;
		padding: 20rpx;
		margin: 8rpx 0 0 0;
		display: flex;

	}

	.cancel {
		width: 300rpx;
	}

	.fillin {
		width: 300rpx;
		margin-left:60rpx;
		background-color: #0B66FD;
		color: #fff;
	}
</style>
